package com.eggplant.timetools;

import java.util.Timer;
import java.util.TimerTask;

import uij.wf.kf.pouzzt.R;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.eggplant.timetools.base.BaseActivity;
import com.eggplant.timetools.db.TaskItemDb;
import com.umeng.analytics.MobclickAgent;

public class FirstSpashActivity extends BaseActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		Log.e("ydy","********FirstSpashActivity******");
		Timer t = new Timer(true);
		t.schedule(new TimerTask() {

			@Override
			public void run() {
				Intent i = new Intent(FirstSpashActivity.this,
						EggpMainActivity.class);
				i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				startActivity(i);
				finish();

			}
		}, 1200);
		preloadData();
		//MobclickAgent.setDebugMode(true);
		MobclickAgent.updateOnlineConfig(getApplicationContext());
		//String json=SystemUtils.getDeviceInfo(getApplicationContext());
		//MyLog.e("ydy", json);
	}
	
	private void preloadData(){
		new Thread(new Runnable() {
			
			@Override
			public void run() {
				TaskItemDb.getInstance(getApplicationContext()).getTaskList(true);
			}
		});
	}
}
